﻿<UserControl x:Class="VSTalk.Engine.View.RoomEditorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="30" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <TextBlock Text="Room"
                   Grid.Column="0"
                   Grid.Row="0" />
        <TextBox Text="{Binding Model.RoomName, UpdateSourceTrigger=PropertyChanged}"
                 Grid.Column="1"
                 Grid.Row="0"
                 Margin="2" />

        <TextBlock Text="Server"
                   Grid.Column="0"
                   Grid.Row="1" />
        <TextBox Text="{Binding Model.Server, UpdateSourceTrigger=PropertyChanged}"
                 Grid.Column="1"
                 Grid.Row="1"
                 Margin="2" />

        <TextBlock Text="Nickname"
                   Grid.Column="0"
                   Grid.Row="2" />
        <TextBox Text="{Binding Model.Nickname, UpdateSourceTrigger=PropertyChanged}"
                 Grid.Column="1"
                 Grid.Row="2"
                 Margin="2" />

        <StackPanel Grid.Row="3"
                    Grid.ColumnSpan="2"
                    Grid.Column="0"
                    Orientation="Horizontal"
                    HorizontalAlignment="Center">
            <Button Margin="5"
                    Command="{Binding SaveChanges}">Add</Button>
            <Button Margin="5"
                    Command="{Binding RejectChanges}">Cancel</Button>
        </StackPanel>
    </Grid>
</UserControl>
